﻿Imports Kairyu.Load

''' <summary>
''' 遅延読み込みリストファクトリ―
''' </summary>
''' <remarks>
''' #102 LazyListをObservableCollection型継承に変える
''' #104 子結合条件が複数の場合、Fetchができない
''' </remarks>
Public Class LazyListFactory
    Inherits ObservableCollectionFactory

    Public Shadows Function Create(Of ChildT)(instance As Object, rels As IEnumerable(Of ChildRelation), loadQuery As Query(Of ChildT)) As LazyList(Of ChildT)
        Dim lst As New LazyList(Of ChildT)(loadQuery)
        Return Me.SetCollectionChangeEvent(instance, lst, rels.First)
    End Function

End Class
